-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve error message on invalid formatting of shell options #6680
Conversation
abc368f
to
a953f13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Problem: There is no test that ensures that `flux alloc -o foo -o foo.bar=hi` returns an error message that is useful to an end user. Add such a test.
Problem: When submitting a job through the command line, a shell option `-o KEY[=VAL]` is not required to have a value. If one is not provided, then `attributes.system.shell.KEY` is set to 1. If a user later provides a sub-key of this shell option, such as `-o KEY.foo=bar`, the error message returned by Python is not particularly helpful. Wrap `set_treedict()` in a try/except where user input might provide an invalid key and raise a useful error message. Fixes flux-framework#6678
Just a minor point for next time. Not required, but we tend to try to keep the testsuite passing for each commit (sometimes helps with |
Oh, that makes sense. I was trying to show that I did test-driven-development ;) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6680 +/- ##
==========================================
+ Coverage 83.85% 83.87% +0.01%
==========================================
Files 534 534
Lines 88931 88937 +6
==========================================
+ Hits 74577 74593 +16
+ Misses 14354 14344 -10
|
Yeah, that makes sense too (and I usually write the tests first as well) :-) |
Problem: When submitting a job through the command line, a shell option
-o KEY[=VAL]
is not required to have a value. If one is not provided, thenattributes.system.shell.KEY
is set to 1. If a user later provides a sub-key of this shell option, such as-o KEY.foo=bar
, the error message returned by Python is not particularly helpful.Wrap
set_treedict()
in a try/except where user input might provide an invalid key and raise a useful error message.Fixes #6678